package com.zzzyh.forumsystemclient.dao;

import com.zzzyh.forumsystemclient.model.Article;
import com.zzzyh.forumsystemclient.model.PageRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ArticleMapper {
    int insert(Article row);

    int insertSelective(Article row);

    Article selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Article row);

    int updateByPrimaryKeyWithBLOBs(Article row);

    int updateByPrimaryKey(Article row);

    List<Article> getArticles(PageRequest pageRequest);

    int getArticleCount();

    Long getUserIdByArticleId(Long articleId);

    void deleteByPrimaryKey(Long articleId);

    List<Article> getArticlesByUserId(Long userId);

    List<Article> searchArticles(@Param("keyword") String keyword);
}